home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 4 / Amiga Tools 4.iso / tools / netzwerk / tcp-ip / ipdial_v1.9 / ipdial.readme < prev    next >
Text File  |  1996-02-26  |  14KB  |  397 lines

  1. short: SLIP dialer; stdin/out terminal program
  2. type: comm/tcp
  3. author: wiedmann@neckar-alb.de
  4. uploader: wiedmann@neckar-alb.de
  5.  
  6. IPDial - serial device communication program
  7. ============================================
  8.  
  9. IPDial is designed especially for creating a SLIP connection via the modem to a remote host: It can dial the remote hosts number, login into the host and initilize a SLIP connection. Configuring IPDial is rather easy, as it reads its command from a textfile.
  10.  
  11. 1.) Disclaimer: Copyrights, (No) Warranty
  12. -----------------------------------------
  13.  
  14. This program is Copyright (C) 1994
  15.  
  16.     Jochen Wiedmann
  17.     Am Eisteich 9
  18.     72555 Metzingen
  19.     Germany
  20.  
  21.     Phone: (0049) +7123 / 14881
  22.     Mail: wiedmann@neckar-alb.de
  23.     
  24.     Modified with Jochen's OK
  25.     R. William Askew
  26.     askew@neosoft.com  // I found this easier to use than Rexx scripts
  27.                        // once the DSR error was corrected (I like it!!)
  28.  
  29. Permission is granted to make and distribute either verbatim and modified copies of this documentation and the program IPDial provided the copyright notice and this permission notice are preserved on all copies and the "GNU General Public License" (in the file COPYING) is distributed as well.
  30.  
  31. The author gives ABSOLUTELY NO warranty that the program described in this documentation and the results produced by them are correct. The author cannot be held responsible for ANY damage resulting from the use of this software.
  32.  
  33. 2.) Installation
  34. ----------------
  35.  
  36. Rather simple. Just copy the program to a place in your path and edit the two files "login.script" and "hangup.script". (See Script file syntax below for details.)
  37.  
  38. You might want to enter the line
  39.  
  40.     IPDial login.script
  41.  
  42. at the beginning of AmiTCP's startnet script. Thus you get a SLIP connection by simply typing startnet.
  43.  
  44. Similar you could add the line
  45.  
  46.     IPDial hangup.script
  47.  
  48. at the bottom of the stopnet script.
  49.  
  50.  
  51. 3.) Invocation
  52. --------------
  53.  
  54. IPDial is started like this:
  55.  
  56.     IPDial SCRIPT,ECHO/S,VERBOSE/S,TERMINAL/S,DEVICE/K,PROTOCOL/K,
  57.     UNIT/K/N,BAUD/K/N,RAW/S
  58.  
  59. What IPDial does, depends on the TERMINAL switch: If this is active, the arguments DEVICE, UNIT, BAUD and PROTOCOL are used to open the serial.device. Once it is opened, the program acts as a very simple terminal program. See the "terminal" command for an explanation of the RAW argument.
  60.  
  61. If TERMINAL is omitted, the given SCRIPT is read and the commands of the script are executed line by line. (See below) The argument ECHO instructs IPDial to print the modems replies to stdout, while VERBOSE is used to show what the program's doing.
  62.  
  63. 4.) Script file syntax
  64. ----------------------
  65.  
  66. - Any line of the script file may contain only one command. In general command 
  67.   arguments are parsed with ReadArgs(), thus they may look like CLI command line
  68.   arguments: The characters "" may surround a string which contains blanks.
  69.  
  70.   Note, that ReadArgs() treats the character '*' as an escape sequence: Thus you
  71.   have to write
  72.  
  73.     ECHO "**"
  74.  
  75.   if you want to print a single '*'.
  76.  
  77. - Empty lines or lines beginning with a semicolon are assumed to be comments and
  78.   thus ignored.
  79.  
  80. - Lines may begin with a label, an alphanumeric word followed by a colon. Labels
  81.   are ignored, except that they may be used as destinations for "goto"          
  82.   instructions. (Anyone said BASIC? Yes, it is. :-) Labels are case-sensitive.
  83.  
  84. - This is the list of possible commands:
  85.  
  86.     DEVICE NAME/A,PROTOCOL,UNIT/K/N
  87.  
  88.       Opens the given device NAME with unit UNIT (Default 0).
  89.       This must be compatible to the serial.device. PROTOCOL
  90.       may be one of XONXOFF, RTSCTS, 7WIRE (Synonym for RTSCTS)
  91.       or NONE. Note that explicitly requesting a protocol
  92.       overwrites the defaults set by the Derial preferences
  93.       program.
  94.  
  95.       The DEVICE command should in general be the first command
  96.       of each script.
  97.  
  98.     SET BAUD/N/K,DATABITS/N/K,STOPBITS/N/K,BUFSIZE/N/K,PARITY/K
  99.  
  100.       This command is used to modify the serial.device parameters.
  101.       Note, that these overwrite the Serial preferences. Possible
  102.       parameters are:
  103.  
  104.       BAUD        baud rate
  105.       DATABITS    number of databits
  106.       STOPBITS    number of stopbits
  107.       BUFSIZE     read buffer size
  108.       PARITY      one of ODD, EVEN or NONE
  109.  
  110.     SHOWPARMS
  111.  
  112.       Writes the current serial.device settings to stdout.
  113.  
  114.     ECHO ARGS/M
  115.  
  116.       This will write the given ARGS to stdout. Note, that these
  117.       strings may contain patterns like \r (Carriage Return),
  118.       \n (Line Feed), \\ (Backslash :-) or \037 (octal digits,
  119.       representing the character ASCII 31.) The arguments are
  120.       separated by blanks, when they are printed.
  121.  
  122.  Sequences like $VAR or ${VAR} will be replaced with the  value of the environment variable VAR. (Empty string, if  VAR doesn't exist.) Use $$ to get the $ character itself.   Note, that $VAR will only work, if the name VAR consists of alphanumeric characters only and the name is separated with a non-alphanumeric character from the following. For example, $VAR+NAME means $VAR and not $VAR+NAME. On the other hand $VARNAME means $VARNAME and not $VAR. (Obvious reason. :-)
  123.  
  124.  Note that ECHO does not write any Line Feeds or Carriage Returns unless you explicitly request it with the respective patterns.
  125.  
  126.     SEND ARGS/M
  127.  
  128.       This command sends the given strings to the serial.device
  129.       using DoIO(). These strings may contain the same patterns
  130.       as described with the ECHO command. Unlike ECHO the arguments
  131.       aren't separeted by blanks.
  132.  
  133.       See ECHO for a description of patterns that may be inserted
  134.       into SEND arguments.
  135.  
  136.     DELAY SECS/A
  137.  
  138.       Delays the given number of seconds. The value may contain a
  139.       fraction of seconds which is rounded to ticks: 0.5 means
  140.       25 ticks.
  141.  
  142.     WAIT TIMEOUT/K/N/A,ARGS/M
  143.  
  144.       This command waits until either one of the given strings
  145.       is read from the serial.device or the number of seconds
  146.       given by TIMEOUT has gone.
  147.  
  148.       A variable called STATUS indicates what happened: It contains
  149.       either -1 for timeout or the number of the string that was
  150.       read, beginning with 0. This variable may be used by the
  151.       ON statement.
  152.  
  153.       WAIT arguments are parsed like ECHO arguments. (See above.)
  154.  
  155.     SCAN FORMAT/A,GLOBAL/S,SAVE/S
  156.  
  157.       Used to scan the buffer read by the last "WAIT" command for
  158.       certain words. These may be used set environment variables.
  159.       The format string may contain the following patterns:
  160.  
  161.         %{WORD%} Ignores any characters until WORD is found in
  162.                  the buffer. Use %% to insert the '%' character
  163.                  into WORD.
  164.  
  165.         ' '      Ignores any number (including 0) and kind (blank,
  166.                  tab, line feed, carriage return, form feed) of
  167.                  white space characters.
  168.  
  169.      %[VAR%]%(SUFFIX%) Reads the next word from the buffer until
  170.                  the first white space character and stores it into
  171.                  the environment variable VAR.
  172.                  The optional SUFFIX is a sequence of characters
  173.                  to be removed from the end of the word.
  174.                  Any other characters in the format string are simply
  175.                  ignored.
  176.  
  177.  Usually environment variables are local (for IPDial and child processes only). Use the GLOBAL and SAVE keywords to store them in ENV: and ENVARC:, respectively. Note, that SAVE implies GLOBAL.
  178.  
  179.  Note, that you can use the SCAN command more than once on the same buffer.
  180.  
  181.  Example:
  182.  
  183.      SCAN "%{Your IP address is%} %[IPADDRESS]%%(.%)"
  184.  
  185.      Scans the buffer for a sentence like
  186.  
  187.   Your IP address is 145.2.1.34.
  188.  
  189.      and stores the value 145.2.1.34 into the variable IPADDRESS. Note, that the
  190.      character '.' is removed.
  191.  
  192.  The SCAN command stores the number of created environment variables in the STATUS variable, which can later be used by the ON command. Note, that the value -1 is never stored in the STATUS variable, you have to use a dummy label in the
  193.  ON command.
  194.  
  195.     ON STATUS GOTO LABELS/M
  196.  
  197.       There's currently only one version of the ON command.
  198.       An ON command must follow a WAIT or SCAN command. ON reads
  199.       the value of the STATUS variable and jumps to the first
  200.       label, if STATUS is -1, to the second label, if STATUS is 0
  201.       and so on. A typical use of WAIT/ON looks like this:
  202.  
  203.         WAIT TIMEOUT=10 "Login:" "Busy"
  204.         ON STATUS GOTO TimeOut Login Busy
  205.  
  206.         TimeOut:
  207.         ECHO "Timeout happened, aborting.\n"
  208.         EXIT 10
  209.  
  210.         Busy:
  211.         ECHO "Remote busy, delaying...\n"
  212.         DELAY 25
  213.         ECHO "Trying again.\n"
  214.         GOTO DialAgain
  215.  
  216.         Login:
  217.          ;   Execute the login procedure
  218.  
  219.  You do not need to supply a label for any wait string: This will suppress jumping and instead continue on the next line.
  220.  
  221.     GOTO LABEL/A
  222.  
  223.       Jumps to the given label
  224.  
  225.     TERMINAL NOECHO/S,RAW/S,EOF
  226.  
  227.       Enters terminal mode: What you enter at the keyboard will
  228.       be sent to the serial.device and likewise the program will
  229.       display any input from the serial.device to you. The
  230.       TERMINAL command will be finished, if you enter EOF
  231.       (Ctrl-\).
  232.  
  233.       The NOECHO and EOF options can be used to enter a password,
  234.       if you don't like to include it into your login file: NOECHO
  235.       makes your input invisible and the EOF string terminates
  236.       terminal mode as soon, as you type in the first character
  237.       of the string. Thus you can do something like
  238.  
  239.         WAIT TIMEOUT=10 "Password:"
  240.         ON STATUS GOTO TimeOut Password
  241.  
  242.         Password:
  243.         ECHO "Enter login password: "
  244.         TERMINAL EOF="\n" NOECHO
  245.  
  246.       Usually you can send only complete lines to the modem,
  247.       especially this means that you have all editing capabilities
  248.       of the shell available. This is not the case in RAW mode:
  249.       Every character you type will be sent immediately to the
  250.       modem without any buffering or conversions.
  251.  
  252.       Notes:
  253.  
  254.           - You probably must put your modem into NOECHO mode too,
  255.             if you use the "terminal" command for entering a password.
  256.           - NOECHO mode implies RAW mode
  257.  
  258.     SYSTEM ARGS/M
  259.  
  260.       Executes the command given by ARGS. The arguments will be
  261.       parsed like ECHO and SEND arguments (you may insert
  262.       \ and $ patterns) and separated by blanks. The resulting
  263.       string will be executed. For example
  264.  
  265.         SYSTEM "Echo" "Hello!"
  266.  
  267.       will execute the command "Echo Hello!" and not "EchoHello!".
  268.  
  269.         EXIT RESULT
  270.  
  271.       Terminates the program, returns the given RESULT. (Defaults
  272.       to 0.)
  273.  
  274.     SETVAR NAME/A,VALUE/A,LOCALONLY/S,GLOBAL/S,SAVE/S
  275.  
  276.       Sets environment variable NAME to VALUE. If you set the
  277.       GLOBAL switch, your variable will be set in ENV: and not
  278.       in the programs local environment. The SAVE switch forces
  279.       copying to ENVARC:.
  280.  
  281.       Note, that SAVE implies GLOBAL.
  282.  
  283.        Commands are case-insensitive.
  284.  
  285. See the scripts Login.IPDial and Hangup.IPDial as examples.
  286.  
  287.  
  288. 5.) How to create a script file?
  289. --------------------------------
  290.  
  291. Enter the terminal mode. You should now be able to type commands like
  292.  
  293.     ATZ<return>
  294.  
  295. If all goes well, the modem should reply
  296.  
  297.     ATZ
  298.     OK
  299.  
  300. provided, that it is in echo mode. Now try to dial into your remote host with something like
  301.  
  302.     ATDP07071927920<return>
  303.  
  304. If the remote host's phone line isn't busy, you should eventually see the remote's login message. This message should explain what to do. Try it and log out. Now have a look at Login.IPDial, in general you should understand how to edit it.
  305.  
  306. 6.) Recommended Usage
  307. ---------------------
  308.  
  309. Each time you reconfigure AmiTCP, it will destroy your startnet script. Thus it is not a good idea to modify the startnet script.  Instead create a scriptfile, say "neton", which could look as follows:
  310.  
  311.     .key ECHO/S,VERBOSE/S
  312.  
  313.     IPDial Work:lib/Login.script <ECHO> <VERBOSE>
  314.     If NOT WARN
  315.       startnet
  316.     EndIf
  317.  
  318. Likewise, create a script "netoff" like this
  319.  
  320.     stopnet
  321.     IPDial Work:lib/Hangup.IPDial
  322.  
  323. And, from now on, use "neton" and "netoff" instead of "startnet" and "stopnet".
  324.  
  325.  
  326. 7.) History
  327. -----------
  328.  
  329. I never expected IPDial to become a little bit popular. However, the number of questions and/or enhancement requests forced new versions: This is 1.6 now. Time for a history, as people might like to know what's different.
  330.  
  331. V 1.1   23.11.94        Initial version
  332.  
  333. V 1.2   27.02.95        Added terminal mode
  334.    Now using ReadArgs() for command line parsing.
  335.  
  336. V 1.3   09.03.95        Added environment variable aupport to "send"
  337.    command. Added unit support.
  338.  
  339.    Suggested by Quarvon (Jürgen Lang)
  340.  
  341. V 1.4   21.04.95        Added "system" command.
  342.  
  343.    Suggested by Gutgolf (Michael Bauer)
  344.  
  345.    Added environment variable support to "echo"
  346.    command. Terminal mode now converts
  347.    LF to CR/LF, so that modem
  348.    recognizes commands.
  349.    (Let's hope, that will still
  350.    work for entering passwords. :-(
  351.  
  352. V 1.5   30.04.95        Added "scan" command.
  353.  
  354. V 1.6   26.06.95        "delay" command supporting ticks; ParseString()
  355.    supporting octal characters; "wait" command using
  356.    ParseString()
  357.  
  358.    Suggested by Will Bow.
  359.  
  360.    Fixed bug in SerialSend():
  361.    *.io_Device = *.io_Unit
  362.  
  363. V 1.7   21.07.95        Added NOECHO, RAW and EOF options to "terminal"
  364.    command.
  365.  
  366.    Suggested by Klaus Heinz
  367.  
  368.    Added BAUD option to command line.
  369.  
  370.    Added "setvar" command.
  371.  
  372. V 1.8   24.11.95        Added a delay() in the DeviceIODo() routine
  373.  
  374.   I have a A2500 with a GVP I/O card connected to a USR sportster v32.bis
  375.   modem.  
  376.   
  377.   I kept getting a no DSR error.
  378.   
  379.   This appears to be a timing problem.
  380.   
  381.   
  382.   status = DoIO(req->Req);
  383.   Delay(10);                   /* delay 10 ticks so modem has a chance */
  384.   return(status);
  385.   
  386.   Converted to compiled with SAS/C 6.xx
  387.   
  388.   Added some more VERBOSE ( for better or worse )
  389.   
  390.   
  391.   R. William Askew               A Harley Ride a Day
  392.                               Helps Drive the Blues Away
  393.  
  394. V 1.9   29.11.95         Fixed the DELAY command ( oops I broke it in v1.8
  395.  
  396.   
  397.